<template>
  <div class="top5">
    <div class="five">
      <slot name="header"></slot>
    </div>
    <div class="content">
      <ul>
        <li v-for="item in data" :key="item.id" :class="{ fd: item.num }">
          <p>
            {{ item.name
            }}<span v-if="item.age"
              >{{ item.sex }}{{ item.age }} <button>+关注</button></span
            >
          </p>
          <div v-if="item.num" style="height: 40px">
            <!-- <span>火</span> -->
            <span>{{ item.num }}</span>
          </div>
          <div v-else style="height: 80px">
            <p>{{ item.area }}</p>
            <p>{{ item.school }}</p>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
    },
  },
};
</script>

<style lang="less">
.top5 {
  width: 400px;
  margin: 10px auto;
  .five {
    height: 50px;
    background-color: #008fdb;
    color: white;
    line-height: 50px;
    display: flex;
    justify-content: flex-start;
    button {
      background-color: transparent;
      border: 0;
    }
  }
  .content {
    ul {
      li {
        // height: 40px;
        list-style: none;
        line-height: 40px;
        background-color: #fff;
        border-bottom: 1px solid #ccc;
        padding: 5px;
        p:first-child {
          font-weight: 600;
          span {
            font-weight: normal;
          }
          button {
            width: 60px;
            height: 20px;
            float: right;
            background-color: #008fdb;
            border-radius: 20px;
            border: 0px;
            color: white;
          }
        }
        div:nth-child(2) {
          P {
            font-weight: normal;
          }
        }
      }
    }
  }
}
.fd {
  display: flex;
  justify-content: space-between;
}
</style>
